package com.greenhouse.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.greenhouse.business.domain.BizGroupAlarm;
import com.greenhouse.business.mapper.BizGroupAlarmMapper;
import com.greenhouse.business.service.IBizGroupAlarmService;
import com.greenhouse.common.utils.DateUtils;

/**
 * group_alarmService业务层处理
 * 
 * @author greenhouse
 * @date 2021-05-09
 */
@Service
public class BizGroupAlarmServiceImpl implements IBizGroupAlarmService {
	@Autowired
	private BizGroupAlarmMapper bizGroupAlarmMapper;

	/**
	 * 查询group_alarm
	 * 
	 * @param alarmId group_alarmID
	 * @return group_alarm
	 */
	@Override
	public BizGroupAlarm selectBizGroupAlarmById(Long alarmId) {
		return bizGroupAlarmMapper.selectBizGroupAlarmById(alarmId);
	}

	/**
	 * 查询group_alarm列表
	 * 
	 * @param bizGroupAlarm group_alarm
	 * @return group_alarm
	 */
	@Override
	public List<BizGroupAlarm> selectBizGroupAlarmList(BizGroupAlarm bizGroupAlarm) {
		return bizGroupAlarmMapper.selectBizGroupAlarmList(bizGroupAlarm);
	}

	/**
	 * 新增group_alarm
	 * 
	 * @param bizGroupAlarm group_alarm
	 * @return 结果
	 */
	@Override
	public int insertBizGroupAlarm(BizGroupAlarm bizGroupAlarm) {
		bizGroupAlarm.setCreateTime(DateUtils.getNowDate());
		return bizGroupAlarmMapper.insertBizGroupAlarm(bizGroupAlarm);
	}

	/**
	 * 修改group_alarm
	 * 
	 * @param bizGroupAlarm group_alarm
	 * @return 结果
	 */
	@Override
	public int updateBizGroupAlarm(BizGroupAlarm bizGroupAlarm) {
		bizGroupAlarm.setUpdateTime(DateUtils.getNowDate());
		return bizGroupAlarmMapper.updateBizGroupAlarm(bizGroupAlarm);
	}

	/**
	 * 批量删除group_alarm
	 * 
	 * @param alarmIds 需要删除的group_alarmID
	 * @return 结果
	 */
	@Override
	public int deleteBizGroupAlarmByIds(Long[] alarmIds) {
		return bizGroupAlarmMapper.deleteBizGroupAlarmByIds(alarmIds);
	}

	/**
	 * 删除group_alarm信息
	 * 
	 * @param alarmId group_alarmID
	 * @return 结果
	 */
	@Override
	public int deleteBizGroupAlarmById(Long alarmId) {
		return bizGroupAlarmMapper.deleteBizGroupAlarmById(alarmId);
	}
}
